package com.wwdeng.print.app

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import com.sankuai.mtcashboxsdk.MTCashboxSdkHelper
import com.wwdeng.print.app.databinding.ActMainBinding
import com.wwdeng.print.app.meituan.MeiTuanSdkAct
import com.wwdeng.print.app.printer.PrinterSdkAct

class MainActivity : Activity() {
    lateinit var binding: ActMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        /**
         * 美团SDK
         */
        binding.btnMeiTuanSdk.setOnClickListener {
            startActivity(Intent(this,MeiTuanSdkAct::class.java))
        }

        /**
         * printer SDK
         */
        binding.btnPrinterSdk.setOnClickListener {
            startActivity(Intent(this, PrinterSdkAct::class.java))
        }

        /**
         * 打开钱箱
         */
        binding.btnOpenBox.setOnClickListener {
            MTCashboxSdkHelper.openCashbox()
        }

        logUtil()
    }


    private fun logUtil(){

        printLog("3>>>>>${byteArrayOf(29, 33, 3.toByte())}")
        printLog("17>>>>>${byteArrayOf(29, 33, 17.toByte())}")
    }

    private fun printLog(msg: String){
        Log.e("TAG",">>>>>>>>>>>>>>$msg")
    }

}